(function($, doc) {
	$.init();
	var user = app.getState();
	$.getJSON(nodeurl, function(res) {
		var nodedef = localStorage.getItem('nodeurl');
		var btcnodedef = localStorage.getItem('btcnodeurl');
		doc.getElementById('etharea').innerHTML = template("wallet-template", {
			data: res.eth,
			etype : 'eth',
			def : nodedef
		});

		doc.getElementById('btcarea').innerHTML = template("wallet-template", {
			data: res.btc,
			etype : 'btc',
			def : btcnodedef
		});
		$('.mui-card').on('tap', 'li', function() {
			var etype = this.getAttribute('data-etype');
			var address = this.getAttribute('data-id');
			var el = doc.getElementById(address);
			if(el.checked) {
				return;
			}
			if(etype == 'eth') {
				localStorage.setItem('nodeurl',address);
			}else{
				localStorage.setItem('btcnodeurl',address);
			}
			$.toast("设置成功！");
		});
	});
}(mui, document));